project(boost)

#--profile boost/smart-ptr
#--profile boost/optional
#--profile boost/unordered
#--profile boost/date-time
#--profile boost/multi-index
#--profile boost/uuid

add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/employee-odb.hxx
        ${CMAKE_CURRENT_SOURCE_DIR}/employee-odb.cxx
        PRE_BUILD
        COMMAND echo "-----boost---------"
        COMMAND odb -d mysql --profile boost --generate-schema --generate-query --generate-session employee.hxx
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

#过滤文件
file(GLOB source
        "*.hxx"
        "*.cxx"
        )

message( ${ODB_BOOST_LIBRARY_VAR})



add_executable(${PROJECT_NAME} ${source})

target_link_libraries(${PROJECT_NAME}
        PRIVATE ${ODB_LIBRARY_VAR}
        PRIVATE  ${ODB_MYSQL_LIBRARY_VAR}
        PRIVATE  ${ODB_BOOST_LIBRARY_VAR})